<?php

class Form_Reviewer extends Zend_Form
{

    public function init()
    {
        $id = new Zend_Form_Element_Hidden("id");
        //$id->setLabel("Id: ");
        $id->setValue(0);
        $id->setRequired(true);
        $intValidator = new Zend_Validate_Int();
        $this->addElement($id, "id");
        
        $name = new Zend_Form_Element_Text("name");
        $name->setLabel("Name: ");
        $name->setRequired(true);
        $intValidator = new Zend_Validate_Alpha();
        $this->addElement($name, "name");
        
        
        $photo = new Zend_Form_Element_File("photo");
        $photo->setLabel("Photo: ")->setRequired(true)
        	->setDestination(APPLICATION_PATH . "/../public/images/reviewers_avar/");
        	
        $photoFilter = new Zend_Filter_File_Rename(md5(microtime()) . ".jpg");
        
        $photo->addFilter($photoFilter);
        	
        $photoValidator = new Zend_Validate_File_Extension("jpg");
        $photo->addValidator($photoValidator);
        $this->addElement($photo, "photo");
        
        $submit = new Zend_Form_Element_Submit("submit");
        $this->addElement($submit, "submit");
    }


}

